import request from '@/utils/request'
import { getToken } from '@/utils/auth' // get token from cookie
var token=getToken();
// 列表
export function menuList() {
  return request({
    url: '/menu/list',
    method: 'get',
    headers:{'Content-Type':'application/json'},
  })
}
//新增
export function menuAdd(formData) {
  let newData=JSON.stringify(formData);
  return request({
    url: '/menu/saveOrUpdate',
    method: 'post',
    headers:{'Content-Type':'application/json'},
    data:newData
  })
}
//修改
export function menuUpdata(formData) {
  let newData=JSON.stringify(formData);
  return request({
    url: '/menu/saveOrUpdate',
    method: 'post',
    headers:{'Content-Type':'application/json'},
    data:newData
  })
}

//删除菜单
export function menuDelete(appointBalanceId) {
  return request({
    url: '/menu/delete/'+appointBalanceId,
    method: 'get',
    headers:{'Content-Type':'application/json'},
  })
}
